/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.MOS.javacc.gui;

import br.com.MOS.javacc.SDL.MOSSDLBackend;
import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 *
 * @author Leonardo Baptista (cbs) - http://cbs.net.br
 */
public class Device extends com.sun.dtv.ui.Device{

    public static MOSSDLBackend mosBackend;

    protected Device(){
        super(mosBackend );
    }

    public static void initDevice(){
        mosBackend = new MOSSDLBackend();
        Device x = new Device();
    }

    public static void changeRes(int w, int h, int screen){
        /*
        Runtime run = Runtime.getRuntime();
	try {
	    Process python = run.exec("/home/cbs/projetos/sdl " + w + " " + h + " 32");
	    python.waitFor();
	    BufferedReader in = new BufferedReader( new InputStreamReader(python.getInputStream()) );
	    String line;
	    while ((line = in.readLine()) != null) {
		System.out.print(line);
	    }
	} catch (Exception e) {
	    System.out.println(e.getMessage());
	}
         */
        mosBackend.setRes(w, h);

    }
}
